<?php

/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2017/12/11
 * Time: 16:21
 */
class  Api_Video extends Api_Common {

    public function getRules() {
        return array(
            'carousel' => array(
            ),
            'videoList' =>array(
                'position' => array('name' => 'position', 'type' => 'string', 'require' => true, 'desc' => '位置'),
            ),
        );
    }

    /**
     * 轮播图
     * @return int code 操作码，0表示成功
     * @return string msg 提示信息
     */
    public function carousel(){
        $rs = array('code' => 0, 'msg' => '操作成功', 'info' => array());

        $domain = new Domain_Video();
        $info = $domain->carousel();
        $rs['info'][0] = $info;
        return $rs;
    }

    /**
     * 视频列表
     * @return int code 操作码，0表示成功
     * @return string msg 提示信息
     */
    public function videoList(){
        $rs = array('code' => 0, 'msg' => '操作成功', 'info' => array());
        $position=$this->position;
        $domain = new Domain_Video();
        $info = $domain->videoList($position);
        $rs['info'][0] = $info;
        return $rs;
    }



}